package pack0630.com;

public class Person {
    String name="张无忌";
    public void sing(){
        System.out.println(name+"在唱歌");
    }

    //this要的是属性,否则就是形参(this.name是属性的调用,后面name是形参的调用
    public void sing(String name){
        System.out.println(this.name+"在唱"+name+"这首歌");
    }

    public void sing(String name,int n){
        System.out.println(this.name+"在唱"+name+"这首歌,唱了"+n+"遍");
    }

    public void eat(){
        System.out.println(name+"在吃饭");
    }

}
